import sys
sys.path.append('../src')

import trimesh

from organ import Organ
from tissue import TissueBlock
from pipeline import Pipeline
source = Organ(path='../data/3d-vh-m-kidney-l.glb')
target = Organ(path='../data/3d-vh-m-kidney-r.glb')
source.show()
target.show()
# instantiate the registration pipeline
pipeline = Pipeline(name='Kidney Registration', description='Projecting the Male Left kidney to Male Right Kidney', params='../configs/params.yaml')
pipeline.params
{'nonrigid_registration': {'autotune': 'False',
  'gamma': 10,
  'beta': 2,
  'decimation': 'False',
  'distance_threshold': '1e-8',
  'lambda': 10,
  'downsampling': 'Y, 26443, 0.05',
  'max_iterations': 1000,
  'seed': 26},
 'rigid_registration': {'global_distance_threshold_factor': 0.23,
  'global_edge_length_threshold_factor': 0.95,
  'global_max_correspondence': 0.999,
  'global_max_iterations': 100000,
  'max_nn': 100,
  'refine_distance_threshold_factor': 0.1,
  'voxel_size': 0.025}}
# run registration
projections = pipeline.run(source=source, target=target)
 # display result
projections.registration.show()

Export Projections - Reproducibility and Future Use

from dataclass import Projection
# export (remember to modify the save path)
projections.export(path='../projections/')
# load (remember to modify the load path for the pickle file)
projections = Projection.load(path='../projections/-af981447-fc9a-45c9-a15c-c44dba35740f/projections.pickle')
# helper code to convert notebook to html
!jupyter nbconvert --to html Usage.ipynb
[NbConvertApp] Converting notebook Usage.ipynb to html
[NbConvertApp] Writing 5769656 bytes to Usage.html